3.52 \(\int \frac{\sin ^4(c+d x)}{a+b \tan (c+d x)} \, dx\)

Optimal. Leaf size=158 \[ \frac{\cos ^4(c+d x) (a \tan (c+d x)+b)}{4 d \left (a^2+b^2\right )}-\frac{\cos ^2(c+d x) \left (a \left (5 a^2+b^2\right ) \tan (c+d x)+4 b \left (2 a^2+b^2\right )\right )}{8 d \left (a^2+b^2\right )^2}+\frac{a^4 b \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )^3}+\frac{a x \left (-6 a^2 b^2+3 a^4-b^4\right )}{8 \left (a^2+b^2\right )^3} \]

[Out]

(a*(3*a^4 - 6*a^2*b^2 - b^4)*x)/(8*(a^2 + b^2)^3) + (a^4*b*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2)^
3*d) + (Cos[c + d*x]^4*(b + a*Tan[c + d*x]))/(4*(a^2 + b^2)*d) - (Cos[c + d*x]^2*(4*b*(2*a^2 + b^2) + a*(5*a^2
 + b^2)*Tan[c + d*x]))/(8*(a^2 + b^2)^2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.338949, antiderivative size = 158, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3516, 1647, 801, 635, 203, 260} \[ \frac{\cos ^4(c+d x) (a \tan (c+d x)+b)}{4 d \left (a^2+b^2\right )}-\frac{\cos ^2(c+d x) \left (a \left (5 a^2+b^2\right ) \tan (c+d x)+4 b \left (2 a^2+b^2\right )\right )}{8 d \left (a^2+b^2\right )^2}+\frac{a^4 b \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )^3}+\frac{a x \left (-6 a^2 b^2+3 a^4-b^4\right )}{8 \left (a^2+b^2\right )^3} \]

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]^4/(a + b*Tan[c + d*x]),x]

[Out]

(a*(3*a^4 - 6*a^2*b^2 - b^4)*x)/(8*(a^2 + b^2)^3) + (a^4*b*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2)^
3*d) + (Cos[c + d*x]^4*(b + a*Tan[c + d*x]))/(4*(a^2 + b^2)*d) - (Cos[c + d*x]^2*(4*b*(2*a^2 + b^2) + a*(5*a^2
 + b^2)*Tan[c + d*x]))/(8*(a^2 + b^2)^2*d)

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 1647

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[(d +
 e*x)^m*Pq, a + c*x^2, x], f = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + c*x^2, x], x, 0], g = Coeff[Polyn
omialRemainder[(d + e*x)^m*Pq, a + c*x^2, x], x, 1]}, Simp[((a*g - c*f*x)*(a + c*x^2)^(p + 1))/(2*a*c*(p + 1))
, x] + Dist[1/(2*a*c*(p + 1)), Int[(d + e*x)^m*(a + c*x^2)^(p + 1)*ExpandToSum[(2*a*c*(p + 1)*Q)/(d + e*x)^m +
 (c*f*(2*p + 3))/(d + e*x)^m, x], x], x]] /; FreeQ[{a, c, d, e}, x] && PolyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] &
& LtQ[p, -1] && ILtQ[m, 0]

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{\sin ^4(c+d x)}{a+b \tan (c+d x)} \, dx &=\frac{b \operatorname{Subst}\left (\int \frac{x^4}{(a+x) \left (b^2+x^2\right )^3} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{\operatorname{Subst}\left (\int \frac{\frac{a^2 b^4}{a^2+b^2}-\frac{3 a b^4 x}{a^2+b^2}-4 b^2 x^2}{(a+x) \left (b^2+x^2\right )^2} \, dx,x,b \tan (c+d x)\right )}{4 b d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) \left (4 b \left (2 a^2+b^2\right )+a \left (5 a^2+b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{\operatorname{Subst}\left (\int \frac{\frac{a^2 b^4 \left (3 a^2-b^2\right )}{\left (a^2+b^2\right )^2}-\frac{a b^4 \left (5 a^2+b^2\right ) x}{\left (a^2+b^2\right )^2}}{(a+x) \left (b^2+x^2\right )} \, dx,x,b \tan (c+d x)\right )}{8 b^3 d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) \left (4 b \left (2 a^2+b^2\right )+a \left (5 a^2+b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{\operatorname{Subst}\left (\int \left (\frac{8 a^4 b^4}{\left (a^2+b^2\right )^3 (a+x)}+\frac{a b^4 \left (3 a^4-6 a^2 b^2-b^4-8 a^3 x\right )}{\left (a^2+b^2\right )^3 \left (b^2+x^2\right )}\right ) \, dx,x,b \tan (c+d x)\right )}{8 b^3 d}\\ &=\frac{a^4 b \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) \left (4 b \left (2 a^2+b^2\right )+a \left (5 a^2+b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{(a b) \operatorname{Subst}\left (\int \frac{3 a^4-6 a^2 b^2-b^4-8 a^3 x}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^3 d}\\ &=\frac{a^4 b \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) \left (4 b \left (2 a^2+b^2\right )+a \left (5 a^2+b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}-\frac{\left (a^4 b\right ) \operatorname{Subst}\left (\int \frac{x}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{\left (a^2+b^2\right )^3 d}+\frac{\left (a b \left (3 a^4-6 a^2 b^2-b^4\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^3 d}\\ &=\frac{a \left (3 a^4-6 a^2 b^2-b^4\right ) x}{8 \left (a^2+b^2\right )^3}+\frac{a^4 b \log (\cos (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{a^4 b \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{\cos ^2(c+d x) \left (4 b \left (2 a^2+b^2\right )+a \left (5 a^2+b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}\\ \end{align*}

Mathematica [A]  time = 2.59212, size = 249, normalized size = 1.58 \[ -\frac{a \left (6 a^2 b^3+5 a^4 b+b^5\right ) \sin (2 (c+d x))-4 b^2 \left (a^2+b^2\right )^2 \cos ^4(c+d x)+8 b^2 \left (3 a^2 b^2+2 a^4+b^4\right ) \cos ^2(c+d x)+2 a b \left (6 a^2 b^2+5 a^4+b^4\right ) \tan ^{-1}(\tan (c+d x))+8 a^4 \left (-2 b^2 \log (a+b \tan (c+d x))+\left (a \sqrt{-b^2}+b^2\right ) \log \left (\sqrt{-b^2}-b \tan (c+d x)\right )+\left (b^2-a \sqrt{-b^2}\right ) \log \left (\sqrt{-b^2}+b \tan (c+d x)\right )\right )-4 a b \left (a^2+b^2\right )^2 \sin (c+d x) \cos ^3(c+d x)}{16 b d \left (a^2+b^2\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]^4/(a + b*Tan[c + d*x]),x]

[Out]

-(2*a*b*(5*a^4 + 6*a^2*b^2 + b^4)*ArcTan[Tan[c + d*x]] + 8*b^2*(2*a^4 + 3*a^2*b^2 + b^4)*Cos[c + d*x]^2 - 4*b^
2*(a^2 + b^2)^2*Cos[c + d*x]^4 + 8*a^4*((b^2 + a*Sqrt[-b^2])*Log[Sqrt[-b^2] - b*Tan[c + d*x]] - 2*b^2*Log[a +
b*Tan[c + d*x]] + (b^2 - a*Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[c + d*x]]) - 4*a*b*(a^2 + b^2)^2*Cos[c + d*x]^3*
Sin[c + d*x] + a*(5*a^4*b + 6*a^2*b^3 + b^5)*Sin[2*(c + d*x)])/(16*b*(a^2 + b^2)^3*d)

________________________________________________________________________________________

Maple [B]  time = 0.068, size = 565, normalized size = 3.6 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)^4/(a+b*tan(d*x+c)),x)

[Out]

-5/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^3*a^5-3/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^3*a^3*b
^2-1/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^3*a*b^4-1/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^2*a^4
*b-3/2/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^2*a^2*b^3-1/2/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^2
*b^5-3/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)*a^5-1/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)*a^3*b
^2+1/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)*a*b^4-3/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*a^4*b-1/d/(a^2+b
^2)^3/(1+tan(d*x+c)^2)^2*a^2*b^3-1/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*b^5-1/2/d/(a^2+b^2)^3*ln(1+tan(d*x+c)^2)
*a^4*b+3/8/d/(a^2+b^2)^3*arctan(tan(d*x+c))*a^5-3/4/d/(a^2+b^2)^3*arctan(tan(d*x+c))*a^3*b^2-1/8/d/(a^2+b^2)^3
*arctan(tan(d*x+c))*a*b^4+1/d*b/(a^2+b^2)^3*a^4*ln(a+b*tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.65528, size = 378, normalized size = 2.39 \begin{align*} \frac{\frac{8 \, a^{4} b \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac{4 \, a^{4} b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (3 \, a^{5} - 6 \, a^{3} b^{2} - a b^{4}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac{{\left (5 \, a^{3} + a b^{2}\right )} \tan \left (d x + c\right )^{3} + 6 \, a^{2} b + 2 \, b^{3} + 4 \,{\left (2 \, a^{2} b + b^{3}\right )} \tan \left (d x + c\right )^{2} +{\left (3 \, a^{3} - a b^{2}\right )} \tan \left (d x + c\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \tan \left (d x + c\right )^{4} + a^{4} + 2 \, a^{2} b^{2} + b^{4} + 2 \,{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \tan \left (d x + c\right )^{2}}}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/8*(8*a^4*b*log(b*tan(d*x + c) + a)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 4*a^4*b*log(tan(d*x + c)^2 + 1)/(a^
6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (3*a^5 - 6*a^3*b^2 - a*b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) -
 ((5*a^3 + a*b^2)*tan(d*x + c)^3 + 6*a^2*b + 2*b^3 + 4*(2*a^2*b + b^3)*tan(d*x + c)^2 + (3*a^3 - a*b^2)*tan(d*
x + c))/((a^4 + 2*a^2*b^2 + b^4)*tan(d*x + c)^4 + a^4 + 2*a^2*b^2 + b^4 + 2*(a^4 + 2*a^2*b^2 + b^4)*tan(d*x +
c)^2))/d

________________________________________________________________________________________

Fricas [A]  time = 2.28896, size = 481, normalized size = 3.04 \begin{align*} \frac{4 \, a^{4} b \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) +{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) + 2 \,{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{4} +{\left (3 \, a^{5} - 6 \, a^{3} b^{2} - a b^{4}\right )} d x - 4 \,{\left (2 \, a^{4} b + 3 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{2} +{\left (2 \,{\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{3} -{\left (5 \, a^{5} + 6 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \,{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/8*(4*a^4*b*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2) + 2*(a^4*b + 2*a^2*b^3 +
b^5)*cos(d*x + c)^4 + (3*a^5 - 6*a^3*b^2 - a*b^4)*d*x - 4*(2*a^4*b + 3*a^2*b^3 + b^5)*cos(d*x + c)^2 + (2*(a^5
 + 2*a^3*b^2 + a*b^4)*cos(d*x + c)^3 - (5*a^5 + 6*a^3*b^2 + a*b^4)*cos(d*x + c))*sin(d*x + c))/((a^6 + 3*a^4*b
^2 + 3*a^2*b^4 + b^6)*d)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)**4/(a+b*tan(d*x+c)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.19573, size = 451, normalized size = 2.85 \begin{align*} \frac{\frac{8 \, a^{4} b^{2} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}} - \frac{4 \, a^{4} b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (3 \, a^{5} - 6 \, a^{3} b^{2} - a b^{4}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{6 \, a^{4} b \tan \left (d x + c\right )^{4} - 5 \, a^{5} \tan \left (d x + c\right )^{3} - 6 \, a^{3} b^{2} \tan \left (d x + c\right )^{3} - a b^{4} \tan \left (d x + c\right )^{3} + 4 \, a^{4} b \tan \left (d x + c\right )^{2} - 12 \, a^{2} b^{3} \tan \left (d x + c\right )^{2} - 4 \, b^{5} \tan \left (d x + c\right )^{2} - 3 \, a^{5} \tan \left (d x + c\right ) - 2 \, a^{3} b^{2} \tan \left (d x + c\right ) + a b^{4} \tan \left (d x + c\right ) - 8 \, a^{2} b^{3} - 2 \, b^{5}}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}{\left (\tan \left (d x + c\right )^{2} + 1\right )}^{2}}}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/8*(8*a^4*b^2*log(abs(b*tan(d*x + c) + a))/(a^6*b + 3*a^4*b^3 + 3*a^2*b^5 + b^7) - 4*a^4*b*log(tan(d*x + c)^2
 + 1)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (3*a^5 - 6*a^3*b^2 - a*b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4
 + b^6) + (6*a^4*b*tan(d*x + c)^4 - 5*a^5*tan(d*x + c)^3 - 6*a^3*b^2*tan(d*x + c)^3 - a*b^4*tan(d*x + c)^3 + 4
*a^4*b*tan(d*x + c)^2 - 12*a^2*b^3*tan(d*x + c)^2 - 4*b^5*tan(d*x + c)^2 - 3*a^5*tan(d*x + c) - 2*a^3*b^2*tan(
d*x + c) + a*b^4*tan(d*x + c) - 8*a^2*b^3 - 2*b^5)/((a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6)*(tan(d*x + c)^2 + 1)^2
))/d